/*
 * @Description: svgIcon组件
 * @Author: DHL
 * @Date: 2021-12-10 15:21:09
 * @LastEditors: DHL
 * @LastEditTime: 2022-08-02 15:21:44
 */

import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'
import path from 'path';

export default function createSvgIcon(isBuild: boolean) {
  return createSvgIconsPlugin({
    iconDirs: [path.resolve(process.cwd(), 'src/icons/svg')],
    symbolId: 'icon-[dir]-[name]',
    svgoOptions: isBuild
  });
}
